package com.lzx.adx.report.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lzs.adx.commmon.service.impl.CrudServiceImpl;
import com.lzx.adx.report.dao.OcpxConfigDao;
import com.lzx.adx.report.dto.OcpxConfigDTO;
import com.lzx.adx.report.entity.OcpxConfigEntity;
import com.lzx.adx.report.service.OcpxConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.Objects;

/**
 * 
 *
 * @author wangzhijun 825400558@qq.com
 * @since 1.0.0 2024-10-03
 */
@Service
public class OcpxConfigServiceImpl extends CrudServiceImpl<OcpxConfigDao, OcpxConfigEntity, OcpxConfigDTO> implements OcpxConfigService {

    @Override
    public QueryWrapper<OcpxConfigEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");
        Integer status = (Integer)params.get("status");

        QueryWrapper<OcpxConfigEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);
        wrapper.eq(Objects.nonNull(status), "status", status);

        return wrapper;
    }


}